<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<title>个人中心</title>
	<link rel="stylesheet" href="../css/personal.css" />
	<script type="text/javascript">
		document.addEventListener('plusready', function () {
			//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"	
		});
	</script>
	<script type="text/javascript" src="../js/zepto.js"></script>
	<script src= "../js/jquery.min.js"></script>
	<script src="../js/touch.min.js"></script>
	
	<!-- <script src= "../js/jquery.cookie.js"></script> -->
	<script src="../js/personal.js"></script>
	<script src="../js/layer/layer.js"></script>
	
	<style>
		#touxiang{
			width: 0.325rem;
			height:0.325rem;
			border-radius: 50%;
			background: url("../img/login.png");
			background-repeat: no-repeat !important;
			background-position: center !important;
			background-size: cover !important; 
			display: inline-block;
			vertical-align: top;
		}
		.top-info .box-info div{
			width: 0.58rem;
			white-space: nowrap;
			overflow: hidden;
			text-overflow:ellipsis;
		}
		.footer-nav{
		width: 100%;
		background-color: white;
		position: fixed;
		bottom:0;
		left: 0;
		height: 0.49rem;
		box-shadow: 0rem 0rem 1rem 0rem
		rgba(43, 29, 29, 0.1);
	}
	.footer-nav li{
		float: left;
		width: 25%;
		height: 0.49rem;
		line-height: 0.49rem;
		text-align: center;
		/*padding-top:1rem;*/
	}
	.footer-nav li a{
		display: block;
		text-decoration: none;
		color: #afafaf;
		height: 0.49rem;
		line-height: 0.25rem;
	}
	.footer-nav li img{
		width: 0.2rem;
		height:0.2rem;
		display: inline-block;
		vertical-align: middle;
	}
	.footer-nav li p{
		/*padding-top: 0.1rem;*/
		height: 0.19rem;
		line-height: 0.19rem;
		font-size: 0.1rem;
		font-weight: normal;
		font-stretch: normal;
		letter-spacing: 0.01rem;
		color: #afafaf;
	}
	</style>
</head>

<body>
	<div class="wrapper-header">
		<div class="wrapper">
			<div class="header">
				<div class="arrow">
					<img src="../img/arrow.png" alt="" >
				</div>
				<div class="con">个人中心</div>
				<div class="dot">
					<img src="../img/dot.png" alt="">
				</div>
			</div>
		</div>
		<div class="box-entry">
			<!-- <img src="../img/login.png" alt="" id="touxiang"> -->
			<div id="touxiang"></div>
			<a class="login" id="login" href="../te/login/login.html">点击登录</a>
			<span>欢迎来到云网</span>
		</div>

	</div>

	<div class="top-info">
		<div class="box-info">
			<div class="shouyi">
				<p class="top" id="shouyi">0</p>
				<p class="bottom">累计收益</p>
			</div>
			<div class="yue">
				<p class="top" id="cash_money">0</p>
				<p class="bottom">余额</p>
			</div>
			<div class="yunbi">
				<p class="top" id="total_cloud_money">0</p>
				<p class="bottom">云币</p>
			</div>
		</div>
	</div>
	<div class="zhedang"></div>
	<div class="chengkai"></div>
	<div class="wrapper-content">
		<ul class="wrapper-list">
			<a href="gerenziliao.html"></a>
			<li>
				<img src="../img/geren.png" alt="">
			</li>
			<li>个人资料</li>
			<li><img src="../img/right-arrow.png" alt=""></li>

		</ul>
		<ul class="wrapper-list">
			<a href="wodekuangji.html"></a>
			<li>
				<img src="../img/kuangji.png" alt="">
			</li>
			<li>我的矿机</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list">
			<a href="yunbimingxi.html"></a>
			<li>
				<img src="../img/jiaoyi.png" alt="">
			</li>
			<li>交易记录</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list nojump">
			<a href="kefuzhongxin.html"></a>
			<li>
				<img src="../img/kefu.png" alt="">
			</li>
			<li>客服中心</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list">
			<a href="zhanghuzhongxin.html"></a>

			<li>
				<img src="../img/zhanghu.png" alt="">
			</li>
			<li>账户中心</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list">
			<a href="wodetuijianma.html"></a>

			<li>
				<img src="../img/tuiguang.png" alt="">
			</li>
			<li>我的推荐码</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list">
			<a href="wodetuandui.html"></a>

			<li>
				<img src="../img/tuandui.png" alt="">
			</li>
			<li>我的团队</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list nojump">
			<a href="guanfang.html"></a>

			<li>
				<img src="../img/qq.png" alt="">
			</li>
			<li>官方QQ群</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>

		<ul class="wrapper-list">
			<a href="anquanzhongxin.html"></a>

			<li>
				<img src="../img/anquan.png" alt="">
			</li>
			<li>安全中心</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list nojump  gg">

			<li>
				<img src="../img/gonggao.png" alt="">
			</li>
			<li>公告中心</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list">
			<a href="wodeqianbao.html"></a>

			<li>
				<img src="../img/qianbao.png" alt="">
			</li>
			<li>我的钱包</li>
			<li>					<img src="../img/right-arrow.png" alt=""></li>
		</ul>
		<ul class="wrapper-list last">

		</ul>

	</div>
	
	<div class="footer-nav">
		<ul>
			<li>
				<a href="../yunlianbi/index.html">
					<img src="../img/shouye-bottom.png" alt=""><p>首页</p>
				</a>
			</li>
			<li><a href="#"><img src="../yunlianbi/images/jiaoyi.png" alt="" id="jiaoyi"><p>交易</p></a></li>
			<li><a href="../yunlianbi/notice.html"><img src="../yunlianbi/images/guanggao.png" alt="" id="kuangji"><p>公告</p></a></li>
			
			<li><a href="#"><img src="../img/geren-bottom.png" alt=""><p>个人中心</p></a></li>
		</ul>
			
	</div>

	<!-- <div class="wrapper-foot" id= "foot"> -->
		<!--<div class="wrapper-list">
			<a href="http://www.baidu.com"></a>
			<span>
				<img src="../img/shouye-bottom.png" alt="" id="shouye">
			</span>
			<p>首页</p>
		</div>
		<div class="wrapper-list">
			<a href="www.baidu.com"></a>

			<span>
				<img src="../img/kuangji-bottom.png" alt="" id="kuangji">
			</span>
			<p>矿机</p>
		</div>
		<div class="wrapper-list">
			<a href="www.baidu.com"></a>

			<span>
				<img src="../img/jiaoyi-bottom.png" alt="" id="jiaoyi">
			</span>
			<p>交易</p>
		</div>
		<div class="wrapper-list active" >
			<a href="www.baidu.com"></a>

			<span>
				<img src="../img/geren-bottom.png" alt="" id="geren">
			</span>
			<p>个人中心</p>
		</div>-->

	<!-- </div> -->
	
	<script type="text/javascript">


//		$(".yunbi").click(function () {
//			window.location.href='zijinzhanghu.html'
//        })


		$(function(){
			$("#foot").load("../footer.html")
		})
		$(".yunbi").on("tap",function(){
			window.location.href = "zijinzhanghu.html"
		})
		$(".yue").on("tap",function(){
			window.location.href = "jiaoyijilu.html"
		})
		$(".arrow").on("tap",function(){
			window.location.href = "../yunlianbi/index.html"
		})
		$("#kuangji").on("tap",function(){
			layer.msg("待启用")
		})
		$("#jiaoyi").on("tap",function(){
			layer.msg("待启用")
		})
		//存值


		localStorage.success = 1;
		localStorage.erro = 0;
		//判断是否登录


        $(".gg").click(function () {
            window.location.href='../yunlianbi/notice.html';
            localStorage.uid=1;
        })


		function render(){
			$.ajax({
				type: "POST",
				url:`${localStorage.top}api/UserCenter/index?TOKEN=${localStorage.token}`,
				success: successed,
				data: {
					// "TOKEN"
				}
			})
		}
		render();


		function successed (data){
			if(data.data.is_login == 0){
				//未登录
				$("#login").on("tap",function(){
					window.location.href = "跳登录页面";
				})
				//跳转登录页面
				$(".wrapper-list a").not(".nojump").on("click",function(){
					return false;
				})
				$(".wrapper-list").not(".nojump").on("tap",function(){
					window.location.href = "../te/login/login.html"

				})
				changeContent(data)

			}else{
				changeContent(data);
				$("#login").html(data.data.nickname).attr("href","#");
			}

			console.log(data)
		}

		function changeContent(data){
			//测试
			$("#touxiang").css("background",`url('${data.data.avatar}')`)			
			// $("#touxiang").css("background","url('http://192.168.0.24/cloudcoin/public/uploads/avatar/20180628/039cfb8a4fa9823490c5cf14e9574777.jpg')");
			
			$("#shouyi").html(data.data.earnings);
			$("#cash_money").html(data.data.cash_money);
			$("#total_cloud_money").html(data.data.total_cloud_money);

			localStorage.nickname = data.data.nickname;
			localStorage.cash_money = data.data.cash_money;
			localStorage.cloud_money = data.data.cloud_money;
			localStorage.total_cloud_money = data.data.total_cloud_money;

		}
		$.ajax({
			type:"GET",
			url: `${localStorage.top}api/usercenter/get_user_info?TOKEN=${localStorage.token}`,
			success: function(data){
				console.log(data)
				localStorage.alipay_id = data.data.alipay_id;
				localStorage.avatar = data.data.avatar;
				localStorage.bank_card_name = data.data.bank_card_name;
				localStorage.bank_card = data.data.bank_card;
				localStorage.bank_card_address = data.data.bank_card_address;
				localStorage.cash_money = data.data.cash_money;
				localStorage.cloud_money_freeze = data.data.cloud_money_freeze;
				localStorage.cloud_money_other = data.data.cloud_money_other;
				localStorage.cloud_money_register = data.data.cloud_money_register;
				localStorage.cloud_money_release = data.data.cloud_money_release;
				localStorage.cloud_money_released = data.data.cloud_money_released;
				localStorage.id_number = data.data.id_number;
				localStorage.mobile = data.data.mobile;
				localStorage.realname = data.data.realname;
				localStorage.username = data.data.username;
				localStorage.wechat_id = data.data.wechat_id;
				
			}
		})

		//获取推荐码和图片链接
		 $.ajax({
		 	type: "GET",
		 	url:`${localStorage.top}api/UserCenter/getGeneralizeQrcode?TOKEN=${localStorage.token}`,
		 	success: function(data){
		 		console.log(data)
		 		localStorage.weiCodeUrl = data.data.qrcode_url;
		 		localStorage.tuijianma = data.data.invite_code;
				console.log(localStorage.tuijianma)
		 	},
		 })


	</script>
	
	
	
</body>

</html>